package gamenetworktest;

import java.io.IOException;
import java.io.ObjectInputStream;


public class Listener implements Runnable{
	ObjectInputStream in;
	
	Listener(ObjectInputStream in) {
		this.in = in;
	}
	
	public void run() {
		String message;
		Analyzer analyzer;
		for(;;) {
			try{
				message = (String)in.readObject();
				analyzer = new Analyzer(message);
				analyzer.Analyze();
				
			}
			catch(ClassNotFoundException classNot){
				System.err.println("data received in unknown format");
			}
			catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
                        
		}
	}
}
